#导入redis模块
from redis import StrictRedis

class COnfig:
    # 配置调试信息
    DEBUG = None
    # 设置秘钥
    SECRET_KEY = 'rMlmlHmW7p78UfuuiS6HJ3sGf9dS36lnCdUY6LIAyVt/TNnjL7bpWIctW'
    # 配置mysql的链接
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info33'
    # 动态追踪修改
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    redis_host = '127.0.0.1'
    redis_port = 6379
    # 设置session信息存储在redis中
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host=redis_host, port=redis_port)
    SESSION_USE_SIGNER = True  # session签名信息
    PERMANENT_SESSION_LIFEIME = 86400 #flask自带的session有效期为31天

#定义开发模式下的配置
class DebelopmentConfig(COnfig):
    DEBUG = True

#定义生产模式下的配置
class productionConfig(COnfig):
    DEBUG = False

#定义字典：
config_dict = {
    'Debelopment': DebelopmentConfig,
    'production' : productionConfig
}
